package com.blank.shop.seata.business;

import com.blank.shop.seata.ShopAlibabaSeataApplication;
import com.blank.shop.seata.domain.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Profile;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * <br/>Date 2021/8/30
 * <br/>Time 16:16:56
 *
 * @author _blank
 */
@Profile({ShopAlibabaSeataApplication.PROFILE_BUSINESS})
@FeignClient(name = HomeController.SERVICE_URL_ORDER)
public interface OrderService {

    /*
     * 注意：服务提供者，服务消费者端，若传递的是实体，两端都要加org.springframework.web.bind.annotation.RequestBody
     */

    /**
     * 创建订单
     *
     * @param order 订单
     * @return org.springframework.http.ResponseEntity
     */
    @PostMapping(path = {"order-create"})
    ResponseEntity<String> create(@RequestBody Order order);

    /**
     * 更新订单状态
     *
     * @param order 订单
     * @return org.springframework.http.ResponseEntity
     */
    @PostMapping(path = {"order-update"})
    ResponseEntity<String> update(@RequestBody Order order);

}
